<?php

namespace app\model;


use think\Model;

class TaskModel extends Model
{

    const STEP_TYPE_STEP = 'step'; // 工序任务
    const STEP_TYPE_STEP_CATEGORY = 'step_category'; // 环节任务
    const STEP_TYPE_STANDARD_REVIEW = 'standard_review'; // 标准审核
    const STEP_TYPE_STANDARD_MEETING = 'standard_meeting'; // 标准会议
    const STEP_TYPE_STANDARD_MAKE_TO_DO = 'standard_make_to_do'; // 标准制作待办
    const STEP_TYPE_WORK_ORDER_TO_DO = 'work_order_to_do'; // 工单待办
    const STEP_TYPE_ENTITY_TO_DO = 'entity_to_do'; // 实体待办
    const STEP_TYPE_TODO = 'to_do'; // 生产待办
    const STEP_TYPE_PERSON = 'person'; // 个人代办
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'task';

    /**
     * The primary key associated with the table.
     *
     * @var string
     */
    protected $primaryKey = 'id';

    /**
     * Indicates if the model should be timestamped.
     *
     * @var bool
     */
    public $timestamps = false;

    /**
     * 关联任务工单表数据
     * @return \think\model\relation\HasOne
     */
    public function taskWorkOrder()
    {
        return $this->hasOne(TaskWorkOrderModel::class, 'task_id', 'id');
    }
}
